package com.sefer.dragonfly.client.core.thread;

import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledThreadPoolExecutor;

/**
 * 定时调度线程工具类
 * 
 * @author xiaofeng 2011-9-8 下午01:28:30
 */
public class ScheduledExecutor {

    public ScheduledExecutor() {
    }

    public static ScheduledExecutorService newScheduledThreadPool(int corePoolSize) {
        return newScheduledThreadPool(corePoolSize, true);
    }

    public static ScheduledExecutorService newScheduledThreadPool(int corePoolSize, boolean isDaemo) {
        return new ScheduledThreadPoolExecutor(corePoolSize, new DaemonThreadFactory(isDaemo));
    }
}
